<? session_start();

class Section{
	
public function view_replace()
{
	
	
	print '
	<table width="650" align="center" bordercolor="#000000" " bgcolor="#ebf9b4" >
	<tr>
		<td align="left" colspan="6" class="cat">Details</td>
    </tr>
        <tr>
			<td class="label" align="center"><strong>No.</strong></td>
            <td class="label" align="center"><strong>Replace Word</strong></td>
            <td class="label" align="center"><strong>Original Word</strong></td>
           <td class="label" align="center"><strong>Date and Time</strong></td>
		     <td class="label" align="center"><strong>Delete</strong></td>
	
	';
		$replace = mysql_query("SELECT * FROM tblreplace WHERE creatorName = 'none'");
		$noOfReplace = mysql_num_rows($replace);
		$loop = 1;
		$ctr = 1;
		
		while($ctr <= $noOfReplace){
		
		while($row_replace = mysql_fetch_assoc($replace)):
			date_default_timezone_set('Asia/Manila');
			$date = date('F j, Y, g:i a', strtotime($row_replace['date']));
			$r = $row_replace['replaceId'];
		
		
		$a++;
		if ($a%2==1)
		{ 
		echo "<tr bgcolor='#e6e4b1'>";
		}
		else
		{
			echo "<tr bgcolor='#c9e362'>";	
		}
		print '
					
						<td align="left">'.$loop.'.</td>
						<td align="center" class="extra">'.$row_replace['replaceWord'].'</a></td>
						<td align="center" class="extra">'.$row_replace['origWord'].'</td>
						<td align="center" class="extra">'.$date.'</td>
						<td align="center" class="extra"><a href="replaceDelete.php?repid='.$r.'"><img width="15" height="15"  src="../images/unchecked.gif"> </a></td>
						';	
		$loop++;
		endwhile;
		$ctr++;
		}
 print '</table>';
	}	


public function view_section(){

	print '
	<table width="650" align="center" bordercolor="#000000" " bgcolor="#ebf9b4" >
	<tr>
		<td align="left" colspan="6" class="cat">Section Details</td>
    </tr>
        <tr>
			<td class="label" align="center"><strong>No.</strong></td>
            <td class="label" align="center"><strong>Section Name</strong></td>
            <td class="label" align="center"><strong>Room Name</strong></td>
            <td class="label" align="center"><strong>Adviser Name</strong></td>
           <td class="label" align="center"><strong>Date and Time</strong></td>
	
	';
		$section = mysql_query("SELECT * FROM tblsection WHERE studentName = 'none'");
		$noOfSection = mysql_num_rows($section);
		$loop = 1;
		$ctr = 1;
		
		while($ctr <= $noOfSection){
		
		while($row_section = mysql_fetch_assoc($section)):
			date_default_timezone_set('Asia/Manila');
			$date = date('F j, Y, g:i a', strtotime($row_section['date']));
		print '
					<tr>
						<td align="left">'.$loop.'.</td>
						<td align="center" class="extra">'.$row_section['sectionName'].'</a></td>
						<td align="center" class="extra">'.$row_section['roomName'].'</td>
						<td align="center" class="extra">'.$row_section['adviserName'].'</td>
						<td align="center" class="extra">'.$date.'</td>
					
						';	
		$loop++;
		endwhile;
		$ctr++;
		}
 print '</table>';

	}
	
public function view_sections(){
		
		print '
	<table width="650" align="center" bordercolor="#000000" " bgcolor="#ebf9b4" >
	<tr>
		<td align="left" colspan="6" class="cat">Section Details</td>
    </tr>
        <tr>
			<td class="label" align="center"><strong>No.</strong></td>
            <td class="label" align="center"><strong>Section Name</strong></td>
            <td class="label" align="center"><strong>Room Name</strong></td>
            <td class="label" align="center"><strong>Adviser Name</strong></td>
           <td class="label" align="center"><strong>Date and Time</strong></td>
	
	';
		$section = mysql_query("SELECT * FROM tblsection WHERE studentName = 'none'");
		$noOfSection = mysql_num_rows($section);
		$loop = 1;
		$ctr = 1;
		
		while($ctr <= $noOfSection){
		
		while($row_section = mysql_fetch_assoc($section)):
			date_default_timezone_set('Asia/Manila');
			$date = date('F j, Y, g:i a', strtotime($row_section['date']));
		print '
					<tr>
						<td align="left">'.$loop.'.</td>
						<td align="center" class="extra">'.$row_section['sectionName'].'</a></td>
						<td align="center" class="extra">'.$row_section['roomName'].'</td>
						<td align="center" class="extra">'.$row_section['adviserName'].'</td>
						<td align="center" class="extra">'.$date.'</td>
					
						';	
		$loop++;
		endwhile;
		$ctr++;
		}
 print '</table>';



	}
	
public function view_section_details()
{
	
	
	print '
	<table width="650" align="center" bordercolor="#000000" " bgcolor="#ebf9b4" >
	<tr>
		<td align="left" colspan="6" class="cat">Section Details</td>
    </tr>
        <tr>
			<td class="label" align="center"><strong>No.</strong></td>
            <td class="label" align="center"><strong>Section Name</strong></td>
            <td class="label" align="center"><strong>Room Name</strong></td>
            <td class="label" align="center"><strong>Adviser Name</strong></td>
           <td class="label" align="center"><strong>Date and Time</strong></td>
	
	';
		$section = mysql_query("SELECT * FROM tblsection WHERE studentName != 'none'");
		$noOfSection = mysql_num_rows($section);
		$loop = 1;
		$ctr = 1;
		
		while($ctr <= $noOfSection){
		
		while($row_section = mysql_fetch_assoc($section)):
			date_default_timezone_set('Asia/Manila');
			$date = date('F j, Y, g:i a', strtotime($row_section['date']));
		print '
					<tr>
						<td align="left">'.$loop.'.</td>
						<td align="center" class="extra">'.$row_section['sectionName'].'</a></td>
						<td align="center" class="extra">'.$row_section['roomName'].'</td>
						<td align="center" class="extra">'.$row_section['adviserName'].'</td>
						<td align="center" class="extra">'.$date.'</td>
					
						';	
		$loop++;
		endwhile;
		$ctr++;
		}
 print '</table>';
	}

	
}



?>